using System;
using System.IO;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography.X509Certificates;

namespace LumiSoft.Net.MIME
{
    /// <summary>
    /// Represents multipart/encrypted MIME enity body. Defined in RFC 1847 2.2.
    /// </summary>
    public class MIME_MultipartSignedBody : MIME_Body
    {
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="owner">Owner MIME entity.</param>
        /// <exception cref="ArgumentNullException">Is raised when <b>owner</b> is null.</exception>
        internal MIME_MultipartSignedBody(MIME_Entity owner) : base(owner)
        {
        }


        /// <summary>
        /// Signs entiy data.
        /// </summary>
        /// <param name="cert"></param>
        public void Sign(X509Certificate2 cert)
        {
        }

        /// <summary>
        /// Verifies that body content has not changed after it was siiged.
        /// </summary>
        public void Verify()
        {
        }


        /// <summary>
        /// Parses MIME entity body from the specified stream.
        /// </summary>
        /// <param name="stream">Stream from where to parse body.</param>
        /// <param name="owner">Specifies if body will be stream owner.</param>
        /// <returns>Returns true if this is last boundary in the message or int multpiart "body parts".</returns>
        internal override bool ParseFromStream(Stream stream,bool owner)
        {
            return true;
        }


        #region override method ToStream

        /// <summary>
        /// Store MIME enity body to the specified stream.
        /// </summary>
        /// <param name="stream">Stream where to store MIME entity. Storing starts form stream current position.</param>
        /// <exception cref="ArgumentNullException">Is raised when <b>stream</b> is null.</exception>
        public override void ToStream(Stream stream)
        {
            if(stream == null){
                throw new ArgumentNullException("stream");
            }

            // TODO:
        }

        #endregion
    }
}
